<?php

class collection extends CActiveRecord
{
	/**
	 * The followings are the available columns in table 'collection':
	 * @var double $req_date
	 * @var double $collected_date
	 * @var integer $from
	 * @var integer $to
	 * @var integer $id
	 * @var double $arrange_date
	 */

	/**
	 * Returns the static model of the specified AR class.
	 * @return CActiveRecord the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'collection';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('from, id', 'required'),
			array('from, to, id', 'numerical', 'integerOnly'=>true),
			array('req_date, collected_date, arrange_date', 'numerical'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'req_date' => 'Req Date',
			'collected_date' => 'Collected Date',
			'from' => 'From',
			'to' => 'To',
			'id' => 'Id',
			'arrange_date' => 'Arrange Date',
		);
	}
}